package creational.singleton;

public class Test {

    public static void main(String[] args) {

        EagerSingleton pEagerSingleton1 = EagerSingleton.getInstance();
        EagerSingleton pEagerSingleton2 = EagerSingleton.getInstance();
        System.out.println(pEagerSingleton1);
        System.out.println(pEagerSingleton2);

        LazySingleton pLazySingleton1 = LazySingleton.getInstance();
        LazySingleton pLazySingleton2 = LazySingleton.getInstance();
        System.out.println(pLazySingleton1);
        System.out.println(pLazySingleton2);

        VolatileSingleton pVolatileSingleton1 = VolatileSingleton.getInstance();
        VolatileSingleton pVolatileSingleton2 = VolatileSingleton.getInstance();
        System.out.println(pVolatileSingleton1);
        System.out.println(pVolatileSingleton2);

        InnerClassSingleton pInnerClassSingleton1 = InnerClassSingleton.getInstance();
        InnerClassSingleton pInnerClassSingleton2 = InnerClassSingleton.getInstance();
        System.out.println(pInnerClassSingleton1);
        System.out.println(pInnerClassSingleton2);

        String strName1 = EnumSingleton.INSTANCE.getInstance();
        String strName2 = EnumSingleton.INSTANCE.getInstance();
        System.out.println(strName1);
        System.out.println(strName2);
    }

}
